package com.struct.factory
{
	import com.collection.DataWorkerCollection;
	import com.struct.graph.create_role.CreateRoleFrame;
	import com.struct.graph.create_role.CreateRoleGraphWorker;
	
	import sacu.s.Factory;
	
	public class CreateRoleFactory extends Factory
	{
		public var createRoleGW:CreateRoleGraphWorker;
		public var createRole:CreateRoleFrame;
		public function CreateRoleFactory(Name:String)
		{
			super(Name);
		}
		
		override protected function onInitFactory():void{
			super.onInitFactory();
			createRole = new CreateRoleFrame();
			createRoleGW = new CreateRoleGraphWorker("CreateRoleGraphWorker", createRole);
		}
		override protected function onStartFactory():void{
			registerDataWorker(DataWorkerCollection.zip);
			registerGraphicsWorker(createRoleGW);
			SSA.application.uiLayer.addChild(createRole);
			createRoleGW.loadInfo();
		}
		override public function disposeFactory():void{
			super.disposeFactory();
			removeDataWorker(DataWorkerCollection.zip.eName);
			removeGraphicsWorker(createRoleGW.eName);
			SSA.application.uiLayer.removeChild(createRole);
		}
	}
}